package com.flute.tools.sql;

public class LimitSQL implements ISQL {
	/**
	 * 
	 */
	private static final long serialVersionUID = 8073415816067491934L;
	private int start;
	private int count;

	public LimitSQL() {
		this.start = 0;
		this.count = 0;
	}
	
	public LimitSQL(int count) {
		this.start = 0;
		this.count = count;
	}

	public LimitSQL(int start, int count) {
		this.start = start;
		this.count = count;
	}

	public int getStart() {
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	@Override
	public String getSQLString() {
		if (count == 0 && start == 0) {
			return "";
		} else if (count != 0 && start == 0) {
			return " limit " + count;
		} else {
			return " limit " + start + ", " + count;
		}
	}

}
